Allow full node to verify author inherent#192
Merged
Conversation
crystalin
reviewed
Jan 20, 2021
| println!("{:?}", call); | ||
| } | ||
| // This if let should always be true. This is the only call that the inehrent could make. | ||
| if let Self::Call::set_author(claimed_author) = call { |
Collaborator
There was a problem hiding this comment.
I don't understand why it is needed to set the author in the check.
Contributor
Author
There was a problem hiding this comment.
I'm pattern matching call, the parameter that was passed into the function, against the variants of the Self::Call enum. set_author is not actually a function and I'm not calling it. It is a variant of the Self::Call enum. This is hard to read because typically enum variants are written in ThisCaseStandard. But the Call enum is an exception because of how the FRAME macros work.
Contributor
There was a problem hiding this comment.
That might be worthy of a comment, although that's probably true of a lot of other cases...
notlesh
reviewed
Jan 20, 2021
4meta5
reviewed
Jan 20, 2021
4meta5
approved these changes
Jan 20, 2021
4meta5
reviewed
Jan 20, 2021
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Changes the inherent checking logic for the author inherent. It was previously "checking" the inherent as if the verifying node had made the inherent. It now checks the actual inherent that the actual author included.
What important points reviewers should know?
Docs for the
ProvideInherenttrait: https://crates.parity.io/sp_inherents/trait.ProvideInherent.html These docs are not great, and I've made an attempt to improve them in paritytech/substrate#7941What alternative implementations were considered?
We considered not checking the inherent at all, but this would remove most of the usefulness of the stake pallet.
What value does it bring to the blockchain users?
It is possible to run full nodes.
Checklist